<div class='fui-page fui-page-current'>
    <div class='fui-content'>
	<!-- 关注提示 -->
	<div class="fui-list-group external" style="margin-top:0" ng-if="pagedata.showwechatcode==1" onclick="$('#followewm').modal();">
		<div class="fui-list">
				<div class="fui-list-media">
					<img class="round" src="{{tomedia(pagedata.account.logo) || '../core/resource/images/nopic.jpg'}}">
				</div>
				<div class="fui-list-inner">
					<div class="title">{{pagedata.account.title}}</div>
					<div class="subtitle">{{pagedata.account.desc}}</div>
				</div>
				<div class="fui-list-angle" style="width: 3rem; margin-right: 0;display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; flex-shrink: 0; flex-wrap: nowrap;">
					<div class="btn btn-sm btn-success" onclick="$('#followewm').modal();"><i class="fa fa-plus"></i> 关注</div>
				</div>
		</div>
	</div>
	<div id="carousel-container" class="carousel slide" data-role="carousel" data-param-auto="true" ng-if="pagedata.item.images">
			<div class="carousel-inner" role="listbox">
				<div ng-repeat="nav in pagedata.item.images" ng-class="{'item':1, 'active':$index==0}" >
					<a ng-click="access_json(nav.url)">
						<img ng-src="{{tomedia(nav.picurl) || '../core/resource/images/nopic.jpg'}}" style="display: block; width: 100%; height: 100%;">
					</a>
				</div>
			</div>
			<style>
					.fui-swipe-page .fui-swipe-bullet {width:0.2rem;height:0.2rem;border-radius: 0.2rem;}
					.fui-swipe-page .fui-swipe-bullet.active {opacity: 1;width:0.6rem;border-radius: 0.2rem;}
			</style>
			<div id="carousel-jinyun" class="fui-swipe-page" style="padding: 0 0.2rem; bottom: 0.2rem; ">
				<div class="fui-swipe-bullet" ng-repeat="nav in pagedata.item.images" ng-class="{'active':$index==0}" data-target="#carousel-container" data-slide-to="{{$index}}"></div>
			</div>
		</div>
		<script>
			require(['bootstrap', 'hammer'], function($, Hammer){
				$('#carousel-container').carousel();
				var mc = new Hammer($('#carousel-container').get(0));
				mc.on("panleft", function(ev) {
					$('#carousel-container').carousel('next');
				});
				mc.on("panright", function(ev) {
					$('#carousel-container').carousel('prev');
				});
			});
		</script>
	<div class='jy-content'>
	<div class='fui-cell-group'>
		<div class='fui-cell'>
		<div class='fui-cell-info'>
		   <div class="bold">{{pagedata.item.title}}</div>
		   <div class="gray">{{pagedata.item.desc}}</div>
		</div>
	    </div>
	    <div class='fui-cell'>
		<div class='fui-cell-info'>
		   <div class="bold">礼包价格：￥{{pagedata.item.buyprice}}</div>
		   <div class="gray"> 奖品价值: ￥{{pagedata.item.price}}</div>
		</div>
	    </div>
	</div>
	<div class="fui-list-group goods-list-group" style="background:#fff"> 
	    <div class="fui-list-group-title bold">奖品详情</div>
		<div ng-repeat="g in pagedata.item.set">
			<div ng-if="g.type<=0" class="fui-list">
				<div class="fui-list-media">
					<img ng-src="{{tomedia(g.goods.image)}}" class="round">
				</div>
				<div class="fui-list-inner">
					<div class="text goodstitle">{{g.goods.title}}</div>
					<div class="gray">{{g.goods.subtitle}}</div> 
				</div>
				<div class='fui-list-angle'>
				<span class='marketprice'>￥{{g.goods.price}}</span>
				</div>
			</div>
			<div ng-if="g.type==1" class="fui-list">
				<div class="fui-list-media">
					<i class="icon icon-youhuiquan syscolor" style="font-size:2.3rem"></i>
				</div>
				<div class="fui-list-inner">
					<div class="text goodstitle">[优惠券]{{g.coupon.title}}</div>
					<div class="gray">{{g.coupon.title2}}</div> 
				</div>
				<div class='fui-list-angle'>
					<span class='marketprice'>{{g.coupon.title3}}</span>
				</div>
			</div>
			<div ng-if="g.type==2" class="fui-list">
				<div class="fui-list-media">
					<i class="icon icon-ai-hongbao syscolor" style="font-size:2.3rem"></i>
				</div>
				<div class="fui-list-inner">
					<div class="text goodstitle">[送现金红包]红包</div>
					<div class="gray">会员中心现金红包，可以提现</div> 
				</div>
				<div class='fui-list-angle'>
					<span class='marketprice'>￥{{g.num}}</span>
				</div>
			</div>
			<div ng-if="g.type==3" class="fui-list">
				<div class="fui-list-media">
					<i class="icon icon-jifen1 syscolor" style="font-size:2.3rem"></i>
				</div>
				<div class="fui-list-inner">
					<div class="text goodstitle">[送币]{{g.credit_title}}</div>
					<div class="gray">会员中心查看{{g.credit_title}}，可以消费抵扣</div> 
				</div>
				<div class='fui-list-angle'>
					<span class='marketprice'>{{g.num}}个</span>
				</div>
			</div>
	    </div>
	</div>
	<!--商品详情开始-->
	<div class="detail-block" style="position: relative;margin-top:0.5rem;border-radius: 0.5rem;width:100%;background:#fff;padding-bottom:0">
		<div id="jycontent" class="fui-cell-text bold" style="padding:0.5rem">卡包详情</div>
		<div class="content-block content-images" style="padding:0.5rem;padding-top:0" ng-bind-html="trust(pagedata.item.content)"></div>
	</div>
	</div>
	</div>
    <div class="fui-navbar c" style="height: 3rem;">
		<a ng-if="pagedata.item.buyprice" href="javascript:;" class="nav-item total" style="text-align:left;padding-left:0.5rem">
			<span  class="text-danger bigprice">￥
				<span class="totalprice" style="font-size:1.2rem">{{pagedata.item.buyprice || '0.00'}}</span>
			</span>
		</a>
		<a ng-if="pagedata.order_id" href="javascript:;" class="nav-item btn btn-danger buybtn" ng-click="access_json('jy_shoplibao/orderlist/')" >
			<div class="fee-tag-nav">
				查看订单
			</div>
		</a>
	    <a ng-if="!pagedata.order_id" href="javascript:;" class="nav-item btn btn-danger buybtn" ng-click="pagedata.pay_submit(pagedata.post,'jy_shoplibao/goodsitem/post/','jy_shoplibao/orderlist/')" >
			<div class="fee-tagup-nav">
				确认下单
			</div>
		</a>
    </div>
</div>
<div id="followewm"  class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
		<div class="modal-dialog" style="top:12%">
				<div class="wap-qrcode-container">
					<button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
					<p class="example1">{{pagedata.account.title}}</p>
					<div class="wap-qrcode-image">
						<img ng-src="{{tomedia(pagedata.account.ewm) || '../core/resource/images/nopic.jpg'}}"/>
					</div>
					<p class="example1">长按二维码关注</p>
				</div>
			</div>
</div>
<script type="text/javascript">
scope.pagedata.pay_submit=function(post,post_url,complete_url){
	scope.post_json(post_url,post,function(result){
		if(result.order_id){
			scope.pagedata.order_id=result.order_id;
			scope.$evalAsync();
			scope.tool.pay(result.pay_id,function(res){
					if(res.type=='success'){
						scope.message('支付成功！','success',complete_url);
					}else{
						scope.message('支付失败！','success',complete_url);
					}
			},'','',complete_url,complete_url);
		}
	});
}
</script>